// 环境配置文件
export interface EnvConfig {
  isDevelopment: boolean
  isProduction: boolean
  isTest: boolean
  enableSimulation: boolean
  enableDebug: boolean
  apiBaseUrl: string
}

// 获取当前环境
const getCurrentEnv = (): string => {
  // #ifdef H5
  return process.env.NODE_ENV || 'development'
  // #endif
  
  // #ifdef APP-PLUS
  return 'production'
  // #endif
  
  // #ifdef MP
  return 'production'
  // #endif
  
  return 'development'
}

// 环境配置
export const ENV_CONFIG: EnvConfig = {
  isDevelopment: getCurrentEnv() === 'development',
  isProduction: getCurrentEnv() === 'production',
  isTest: getCurrentEnv() === 'test',
  enableSimulation: getCurrentEnv() === 'development',
  enableDebug: getCurrentEnv() === 'development',
  apiBaseUrl: getCurrentEnv() === 'development' ? 'http://47.86.15.86:3000' : 'https://your-production-domain.com'
}

// 导出环境变量
export const isDevelopment = ENV_CONFIG.isDevelopment
export const isProduction = ENV_CONFIG.isProduction
export const isTest = ENV_CONFIG.isTest
export const enableSimulation = ENV_CONFIG.enableSimulation
export const enableDebug = ENV_CONFIG.enableDebug
